import EnumsBase from "@/_gx/_Base/EnumsBase";

export default {
    /**
     * 是，否
     */
    YesNo: {
        否: 0,
        是: 1,
        objs: {
            0: { text: "否", value: 0, color: "info" },
            1: { text: "是", value: 1, color: "warning" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number | boolean) {
            if (typeof val == "boolean") {
                //把boolean类型转换成数字
                val = val == true ? 1 : 0;
            }

            return EnumsBase._get.call(this, val);
        },
    },

    /**
     * 删除状态
     */
    Delete_Status: {
        启用: 0,
        禁用: 1,
        objs: {
            0: { text: "启用", value: 0, color: "primary" },
            1: { text: "禁用", value: 1, color: "danger" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number | boolean) {
            if (typeof val == "boolean") {
                //把boolean类型转换成数字
                val = val == true ? 1 : 0;
            }

            return EnumsBase._get.call(this, val);
        },
    },

    /******************************************************************************* 下面是系统业务相关 *******************************************************************************/

    //角色  数据权限类型
    Role_DataPermissionType: {
        全部: 0,
        部门: 1,
        objs: {
            0: { text: "全部", value: 0, color: "" },
            1: { text: "部门", value: 1, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //状态标准  类型
    StandStatus_Type: {
        LA: 1,
        DIA: 2,
        LMA: 3,
        综合: 4,
        捻距变化: 5,
        objs: {
            1: { text: "LA", value: 1, color: "" },
            2: { text: "DIA", value: 2, color: "" },
            3: { text: "LMA", value: 3, color: "" },
            4: { text: "综合", value: 4, color: "" },
            5: { text: "捻距变化", value: 5, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //部门  类型
    Department_Type: {
        集团: 1,
        矿山: 2,
        普通: 3,
        objs: {
            1: { text: "集团", value: 1, color: "" },
            2: { text: "矿山", value: 2, color: "" },
            3: { text: "普通", value: 3, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //Token刷新记录  用户登录类型
    RefreshToken_LoginType: {
        集团: 1,
        监管部门: 2,
        超级用户: 3,
        objs: {
            1: { text: "集团", value: 1, color: "" },
            2: { text: "监管部门", value: 2, color: "" },
            3: { text: "超级用户", value: 3, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //出入库业务类型  类型
    OperType_InOutType: {
        入库: 1,
        出库: 2,
        objs: {
            1: { text: "入库", value: 1, color: "" },
            2: { text: "出库", value: 2, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //数据部门  类型
    DataDepartment_Type: {
        用户: 10100,
        角色: 10200,
        部门: 10300,
        状态标准: 20100,
        安装地点: 20200,
        钢丝绳管理: 20300,
        提升机管理: 20400,
        供应商管理: 20500,
        制造商管理: 20600,
        仓库管理: 20700,
        objs: {
            10100: { text: "用户", value: 10100, color: "" },
            10200: { text: "角色", value: 10200, color: "" },
            10300: { text: "部门", value: 10300, color: "" },
            20100: { text: "状态标准", value: 20100, color: "" },
            20200: { text: "安装地点", value: 20200, color: "" },
            20300: { text: "钢丝绳管理", value: 20300, color: "" },
            20400: { text: "提升机管理", value: 20400, color: "" },
            20500: { text: "供应商管理", value: 20500, color: "" },
            20600: { text: "制造商管理", value: 20600, color: "" },
            20700: { text: "仓库管理", value: 20700, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //消息  状态
    Message_Status: {
        未读: 0,
        已读: 200,
        objs: {
            0: { text: "未读", value: 0, color: "danger" },
            200: { text: "已读", value: 200, color: "primary" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //消息  类型
    Message_Type: {
        备绳维保: 1,
        在用绳检测: 2,
        objs: {
            1: { text: "备绳维保", value: 1, color: "" },
            2: { text: "在用绳检测", value: 2, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //单据  类型
    Bill_InOutType: {
        入库: 1,
        出库: 2,
        objs: {
            1: { text: "入库", value: 1, color: "" },
            2: { text: "出库", value: 2, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //单据  状态
    Bill_Status: {
        创建中: 0,
        验收中: 100,
        已验收: 110,
        确认中: 200,
        已确认: 210,
        objs: {
            0: { text: "创建中", value: 0, color: "" },
            100: { text: "验收中", value: 100, color: "" },
            110: { text: "已验收", value: 110, color: "" },
            200: { text: "确认中", value: 200, color: "" },
            210: { text: "已确认", value: 210, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },
    In_Bill_Status: {
        创建中: 0,
        验收中: 100,
        已验收: 110,

        objs: {
            0: { text: "创建中", value: 0, color: "" },
            100: { text: "验收中", value: 100, color: "" },
            110: { text: "已验收", value: 110, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },
    Out_Bill_Status: {
        创建中: 0,
        确认中: 200,
        已确认: 210,
        objs: {
            0: { text: "创建中", value: 0, color: "" },
            200: { text: "确认中", value: 200, color: "" },
            210: { text: "已确认", value: 210, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //备绳维保  状态
    StockWireropeKeep_Status: {
        待维保: 0,
        已维保: 200,
        objs: {
            0: { text: "待维保", value: 0, color: "" },
            200: { text: "已维保", value: 200, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //在用绳检测  状态
    CheckWirerope_Status: {
        // 未提交: 0,
        待检测: 100,
        已检测: 200,
        objs: {
            // 0: { text: "未提交", value: 0, color: "" },
            100: { text: "待检测", value: 100, color: "" },
            200: { text: "已检测", value: 200, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //在用绳检测数据  类型
    CheckWireropeDetailData_Type: {
        断丝: 1,
        直径: 2,
        objs: {
            1: { text: "断丝", value: 1, color: "" },
            2: { text: "直径", value: 2, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //在用绳档案  状态
    UsingWirerope_Status: {
        在用: 1,
        作废: 500,
        objs: {
            1: { text: "在用", value: 1, color: "" },
            500: { text: "作废", value: 500, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //状态监测灯状态
    Light_Type: {
        1: "轻度",
        2: "中度",
        3: "重度",
        4: "严重",
        5: "报废",
        objs: {
            1: { text: "轻度", value: 1, color: "greenLight" },
            2: { text: "中度", value: 2, color: "blueLight" },
            3: { text: "重度", value: 3, color: "yellowLight" },
            4: { text: "严重", value: 4, color: "orangeLight" },
            5: { text: "报废", value: 5, color: "grayLight" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //在用绳档案  状态
    DataEntry_Type: {
        断丝: 1,
        直径: 2,
        objs: {
            1: { text: "断丝", value: 1, color: "" },
            2: { text: "直径", value: 2, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },

    //字典
    Dict: {
        提升用途: 1,
        钢丝绳类型: 2,
        抗拉强度等级MPa: 3,
        表面状态: 4,
        捻制类型: 5,
        绳芯结构: 6,
        入库类型: 7,
        出库类型: 8,
        在用绳维保类型: 9,
        objs: {
            1: { text: "提升用途", value: 1, color: "" },
            2: { text: "钢丝绳类型", value: 2, color: "" },
            3: { text: "抗拉强度等级MPa", value: 3, color: "" },
            4: { text: "表面状态", value: 4, color: "" },
            5: { text: "捻制类型", value: 5, color: "" },
            6: { text: "绳芯结构", value: 6, color: "" },
            7: { text: "入库类型", value: 7, color: "" },
            8: { text: "出库类型", value: 8, color: "" },
            9: { text: "在用绳维保类型", value: 9, color: "" },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },
    //安装类型  状态
    Install_Type: {
        新建: 1,
        换绳: 2,
        objs: {
            1: { text: "新建", value: 1 },
            2: { text: "换绳", value: 2 },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },
    //监测状态状态
    check_Status: {
        待检测: 0,
        已检测: 200,
        objs: {
            0: { text: "待检测", value: 0 },
            200: { text: "已检测", value: 200 },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this);
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },
    //检测类型
    Check_Type: {
        定期: 1,
        日常: 2,
        objs: {
            1: { text: "定期", value: 1 },
            2: { text: "日常", value: 2 },
        },
        ToArray: function () {
            return EnumsBase._toArray.call(this).reverse();
        },
        Get: function (val: number) {
            return EnumsBase._get.call(this, val);
        },
    },
};
